Wallet agreements

The following details help you to simulate the credit card wallet agreement flow

To find out more details about the agreements functionality on the Altapay platform please check the agreements page.


The creation and using of the agreements on the Altapay platform consists of two steps:

  1. Setup the Agreement

    The purpose of this step is to create the agreement.

    You can simulate this step using createPaymentRequest method

    Make createPaymentRequest call with type=subscription and a valid credit card wallet test terminal(terminal with TestCreditCardWalletAcquirer).

          curl --request POST \
          --url https://<YourShopName>.altapaysecure.com/merchant/API/createPaymentRequest \
          --header 'Authorization: Basic auth' \
          --data type=subscription \
          --data `agreement[type]`=recurring \
          --data 'terminal=CreditCardWallet Test Terminal' \
          --data shop_orderid=abc123 \
          --data amount=50 \
          --data currency=EUR \
                                                                

    You will be redirected to a sandbox page which simulates the real case where the customer is redirected to the wallet app to accept or reject the creation of the agreement.

    The simulator page will allow you to accept, cancel or decline the agreement.

  2. Charge the Agreement

    In this step the customer will be debited for the specified agreement.

    This step can be done as many times as needed for an agreement with a customer.

    You can charge an agreement using one of the following methods:

    • /chargeSubscription
    • This method captures the charge agreement payment.

      For more details about the chargeSubscription method, please see chargeSubscription page.

      If the charged amount=13.64, the transaction will remain in PENDING status. This simulates the real case when the wallet transaction is waiting for the customer to accept/reject the charging of the agreement. Please see below what to do next in order to finalize the charging agreement flow.

      Charge subscription request

        curl --request POST \
        --url https://<YourShopName>.altapaysecure.com/merchant/API/chargeSubscription \
        --header 'Authorization: Basic auth' \
        --data 'agreement[id]'=15 \
        --data amount=13.64 \
                              
    • /reserveSubscriptionCharge
    • This method preauthorise the charge agreement payment.

      For more details about the reserveSubscriptionCharge method, please see reserveSubscriptionCharge page.

      If the reserved amount=13.64, the transaction will remain in PENDING status. This simulates the real case when the wallet transaction is waiting for the customer to accept/reject the charging of the agreement. Please see below what to do next in order to finalize the charging agreement flow.

      reserveSubscriptionCharge request

      Reserve subscription request

        curl --request POST \
        --url https://<YourShopName>.altapaysecure.com/merchant/API/reserveSubscriptionCharge \
        --header 'Authorization: Basic auth' \
        --data 'agreement[id]'=15 \
        --data amount=13.64 \
                              

    Simulate customer interaction

    To simulate the customer interaction, you should access a sandbox page which imitate the wallet app where the customer accept or reject the charging of the agreement.

    GET call with transaction_id = TransactionId of the charge agreement payment

    https://testbank.altapaysecure.com/CreditCardWalletChargeAgreement?transaction_id=123&gateway_url=https://<YourShopName>.altapaysecure.com
                                                        

    It opens a sandbox page which allows you to accept or reject the charge agreement payment.

    After accepting/rejecting the charge agreement payment, the transaction will get a final status.

    The merchant will be notified about the changing of the transaction status.